export CC_PREFIX=/home/wk/gpu/loongson_jari_crosscompiler/cross-gcc-4.9.3-n64-loongson-rc6.1

export PATH=${CC_PREFIX}/usr/bin
export ROOTFS=/home/wk/gpu/loongson_jari_rootfs
export CROSS_COMPILE=mips64el-loongson-linux-
export LD_LIBRARY_PATH=${ROOTFS}/usr/lib:${CC_PREFIX}/usr/lib:${CC_PREFIX}/usr/x86_64-unknown-linux-gnu/mips64el-loongson-linux/lib
export TOOLCHAIN=${CC_PREFIX}/usr

export CFLAGS += -mabi=64 -I${ROOTFS}/usr/include  -L${ROOTFS}/lib -L${ROOTFS}/usr/lib -lpthread --sysroot=${ROOTFS}

$(info "LDFLAGS:${LDFLAGS}")
$(info "CFLAGS:${CFLAGS}")
$(info "ROOTFS:${ROOTFS}")
$(info "LD_LIBRARY_PATH: $(LD_LIBRARY_PATH)")

CC=${CROSS_COMPILE}gcc
SRC=thread_demo.c

demo:
	${CC} ${SRC} -o demo ${CFLAGS}  

clean:
	rm demo
